const express = require("express");
// const app = require("../app");

const { query } = require("../conn/conn");

const router = express.Router();

router.get("/getItems", async (req, res, next) => {
  let sql = "select * from product";
  let result = await query(sql);
  res.send(result);
});

router.get('/getItem',async (req,res,next)=>{
  let {id} = req.query;

  let sql = `select * from product where id = ${id}`;

  let result = await query(sql);

  res.send(result);
});

module.exports = router;

